<?php
/**
 * Slipstream :: Highly adaptive dependency injection framework
 * Copyright 2010-2011 Ian Unruh (Xerof3ar)
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
namespace Slipstream\Infrastructure\Context\Relevance;
use Slipstream\Configuration\ContextInterface;

/**
 * The relevance analyzer service uses multiple analyzers that attempt to
 * calculate the weight of a given context in comparison to a target context
 * 
 * This weight value is used to sort contexts to figure out which policies
 * will take precedence over other policies. This value is also used to determine
 * if a policy has any relevance at all to the target context.
 * 
 * The weight score is on a scale of 0-1000; 0 means a context has no
 * relevance to the target context, 1000 means that the context is 
 * the target context; The higher the weight, the more precedence policies
 * bound to that context will have over other contexts.
 * 
 * @author Ian Unruh (Xerof3ar) <ianunruh@gmail.com>
 * @since Class avaliable since release 1.0
 */
interface AnalyzerServiceInterface
{
	/**
	 * Returns the relevance weight of a given context in terms of the target
	 * context
	 * 
	 * @param ContextInterface $context
	 * @param ContextInterface $targetContext
	 * @return int
	 */
	public function getWeight(ContextInterface $context, ContextInterface $targetContext);
}